<?php
namespace app\admin\validate;

use think\Validate;

class UpdatePass extends Validate
{
    protected $rule = [
        'oldPass'      => 'require',
        'newPass'       => 'require',
        'repeatPass'   => 'require|checkPass',
    ];

    protected $message  =   [
        'oldPass'      => '原密码不能为空',
        'newPass'       => '新密码不能为空',
        'repeatPass' => '重复密码不能为空'
    ];

    protected function checkPass($value,$rule,$data)
    {
        return $data['newPass'] == $data['repeatPass'] ? true : '两次输入密码不一致';
    }

}